import { Suspense } from 'react'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import { Icon } from 'antd-mobile'

import routes from './router'
function App() {
  return (
    <Suspense fallback={<Icon type="loading"></Icon>}>
      <Router>
        <Switch>
          {routes.map((route) => (
            <Route {...route} key={route.path} exact></Route>
          ))}
        </Switch>
      </Router>
    </Suspense>
  )
}

export default App
